package com.demo.algorithm.demo5;

/**
 * <p>
 * </p>
 *
 * @author yanyg
 * @date 2024/2/17 16:25
 */
public class InterruptThread2 extends Thread {

    public static void main(String[] args) {
        // 线程默认情况下， interrupt 标记位 false
        System.out.println(Thread.currentThread().isInterrupted());
        // 执行interrupt
        Thread.currentThread().interrupt();
        // interrupt 标记位 true
        System.out.println(Thread.currentThread().isInterrupted());
        // 返回当前线程，并归位为 false   interrupt 标记位 true
        System.out.println(Thread.interrupted());
        // 已经归位了   interrupt 标记位 false
        System.out.println(Thread.interrupted());
    }
}

